{switch name="type" }
{case value="title"}
<div class="layui-form-item">
    <label class="layui-form-label">标题图片</label>
    <div class="layui-input-inline">
        <input type="radio" name="setup[thumb]" value="1" {if condition="$thumb==1"} checked{/if} title="是">
        <input type="radio" name="setup[thumb]" value="0"{if condition="$thumb==0"} checked{/if} title="否">
    </div>
</div>
<div class="layui-form-item">
    <label class="layui-form-label">标题样式</label>
    <div class="layui-input-inline">
        <input type="radio" name="setup[style]" value="1" {if condition="$style==1"} checked{/if} title="是">
        <input type="radio" name="setup[style]" value="0" {if condition="$style==0"} checked{/if} title="否">
    </div>
</div>
{/case}

{case value="text" }
<div class="layui-form-item">
    <div class="layui-inline">
        <label class="layui-form-label">默认值</label>
        <div class="layui-input-inline">
            <input type="text" class="input-text layui-input" size="50"  name="setup[default]" value="{$default}" />
        </div>
    </div>
    <div class="layui-inline">
        <label class="layui-form-label">是否为密码框</label>
        <div class="layui-input-inline">
            <input type="radio" name="setup[ispassword]" value="1" title="是" {if condition="$ispassword==1"} checked{/if}>
            <input type="radio" name="setup[ispassword]" value="0" title="否" {if condition="$ispassword==0"} checked{/if}>
        </div>
    </div>
</div>
<input type="hidden" id="varchar" name="setup[fieldtype]" value="varchar"/>
{/case}

{case value="textarea" }
<div class="layui-form-item">
    <label class="layui-form-label">字段类型</label>
    <div class="layui-input-inline">
        <select name="setup[fieldtype]">
            <option value="mediumtext" <?php if($fieldtype=='mediumtext') echo 'selected';?>>MEDIUMTEXT</option>
            <option value="text" <?php if($fieldtype=='text') echo 'selected';?>>TEXT</option>
        </select>
    </div>
</div>
<div class="layui-form-item">
    <label class="layui-form-label">默认值</label>
    <div class="layui-input-block">
        <textarea  name="setup[default]" class="layui-textarea">{$default}</textarea>
    </div>
</div>
{/case}

{case value="select" }
<div class="layui-form-item">
    <label class="layui-form-label">选项列表</label>
    <div class="layui-col-lg4">
        <textarea  name="setup[options]" class="layui-textarea">{$options}</textarea>
    </div>
    <div class="layui-form-mid layui-word-aux">例：选项名称|值</div>
</div>
<div class="layui-form-item">
    <label class="layui-form-label">选项类型</label>
    <div class="layui-input-inline">
        <input type="radio" name="setup[multiple]" value="0" title="下拉框" {if condition="$multiple==0"} checked{/if}>
        <input type="radio" name="setup[multiple]" value="1" title="多选列表框" {if condition="$multiple==1"} checked{/if}>
    </div>
</div>
<div class="layui-form-item">
    <label class="layui-form-label">字段类型</label>
    <div class="layui-input-inline">
        <select name="setup[fieldtype]" onchange="javascript:numbertype(this.value);">
            <option value="varchar" <?php if($fieldtype=='varchar') echo 'selected';?>>字符 VARCHAR</option>
            <option value="tinyint" <?php if($fieldtype=='tinyint') echo 'selected';?>>整数 TINYINT(3)</option>
            <option value="smallint" <?php if($fieldtype=='smallint') echo 'selected';?>>整数 SMALLINT(5)</option>
            <option value="mediumint" <?php if($fieldtype=='mediumint') echo 'selected';?>>整数 MEDIUMINT(8)</option>
            <option value="int" <?php if($fieldtype=='int') echo 'selected';?>>整数 INT(10)</option>
        </select>
        <span id="numbertype" style="display:none;"  >
            <input type="checkbox" name = "setup[numbertype]" value="1" checked />不包括负数
       </span>
    </div>
</div>
<div class="layui-form-item">
    <label class="layui-form-label">可见选项的数目</label>
    <div class="layui-input-inline">
        <input type="text" class="input-text layui-input" size="5" name="setup[size]" value="{$size}" />
    </div>
</div>
<div class="layui-form-item">
    <label class="layui-form-label">默认值</label>
    <div class="layui-input-inline">
        <input type="text" class="input-text layui-input" size="5"  name="setup[default]" value="{$default}" />
    </div>
</div>
{/case}

{case value="editor"}
<div class="layui-form-item">
    <label class="layui-form-label">编辑器类型</label>
    <div class="layui-input-inline">
        <select name="setup[edittype]">
            <option value="kindeditor" {if $edittype=='kindeditor'} selected{/if}>kindeditor</option>
        </select>
    </div>
</div>
{/case}

{case value="datetime"}

{/case}

{case value="groupid"}
<div class="layui-form-item">
    <label class="layui-form-label">选项类型</label>
    <div class="layui-input-inline">
        <input type="radio" name="setup[inputtype]" value="checkbox" {if condition="$inputtype=='checkbox'"} checked{/if} title="复选框">
        <input type="radio" name="setup[inputtype]" value="select" {if condition="$inputtype=='select'"} checked{/if} title="下拉列表框">
        <input type="radio" name="setup[inputtype]" value="radio" {if condition="$inputtype=='radio'"} checked{/if} title="单选框">
    </div>
</div>
<div class="layui-form-item">
    <label class="layui-form-label">字段类型</label>
    <div class="layui-input-inline">
        <select name="setup[fieldtype]"  onchange="javascript:numbertype(this.value);">
            <option value="varchar" <?php if($fieldtype=='varchar') echo 'selected';?>>字符 VARCHAR</option>
            <option value="tinyint" <?php if($fieldtype=='tinyint') echo 'selected';?>>整数 TINYINT(3)</option>
        </select>
        <span style="display:none;">
            <input type="text" class="input-text layui-input" size="5"  name="setup[default]" value="{$default}" />
        </span>
    </div>
</div>
<div class="layui-form-item">
    <label class="layui-form-label">默认值</label>
    <div class="layui-input-inline">
        <input type="text" class="input-text layui-input" size="5"  name="setup[default]" value="" />
    </div>
</div>
{/case}

{case value="typeid"}
<div class="layui-form-item">
    <label class="layui-form-label">选项类型</label>
    <div class="layui-input-inline">
        <input type="radio" name="setup[inputtype]" value="checkbox" {if condition="$inputtype=='checkbox'"} checked{/if} title="复选框">
        <input type="radio" name="setup[inputtype]" value="select" {if condition="$inputtype=='select'"} checked{/if} title="下拉列表框">
        <input type="radio" name="setup[inputtype]" value="radio" {if condition="$inputtype=='radio'"} checked{/if} title="单选框">
    </div>
</div>
<div class="layui-form-item">
    <label class="layui-form-label">字段类型</label>
    <div class="layui-input-inline">
        <select name="setup[fieldtype]"  onchange="javascript:numbertype(this.value);">
            <option value="varchar" <?php if($fieldtype=='varchar') echo 'selected';?>>字符 VARCHAR</option>
            <option value="tinyint" <?php if($fieldtype=='tinyint') echo 'selected';?>>整数 TINYINT(3)</option>
            <option value="smallint" <?php if($fieldtype=='smallint') echo 'selected';?>>整数 SMALLINT(5)</option>
        </select>
        <span style="display:none;"  >
            <input type="checkbox" name = "setup[numbertype]" value="1" checked title="不包括负数" />
        </span>
    </div>
</div>
<div class="layui-form-item">
    <label class="layui-form-label">顶级类别ID</label>
    <div class="layui-input-inline">
        <input type="text" class="input-text layui-input" size="5"  name="setup[default]" value="{$default}" />
    </div>
</div>
{/case}

{case value="posid"}

{/case}
{case value="radio"}
<div class="layui-form-item">
    <label class="layui-form-label">选项列表</label>
    <div class="layui-col-lg4">
        <textarea class="layui-textarea" name="setup[options]">{$options}</textarea>
    </div>
    <div class="layui-form-mid layui-word-aux">例：选项名称|值</div>
</div>
<div class="layui-form-item">
    <label class="layui-form-label">字段类型</label>
    <div class="layui-input-inline">
        <select name="setup[fieldtype]" onchange="javascript:numbertype(this.value);">
            <option value="varchar" <?php if($fieldtype=='varchar') echo 'selected';?>>字符 VARCHAR</option>
            <option value="tinyint" <?php if($fieldtype=='tinyint') echo 'selected';?>>整数 TINYINT(3)</option>
            <option value="smallint" <?php if($fieldtype=='smallint') echo 'selected';?>>整数 SMALLINT(5)</option>
            <option value="mediumint" <?php if($fieldtype=='mediumint') echo 'selected';?>>整数 MEDIUMINT(8)</option>
            <option value="int" <?php if($fieldtype=='int') echo 'selected';?>>整数 INT(10)</option>
        </select>
        <span id="numbertype" style="display:none;"  >
            <input type="checkbox" name = "setup[numbertype]" value="1" checked title="不包括负数"/>
        </span>
    </div>
</div>
<div class="layui-form-item">
    <label class="layui-form-label">默认值</label>
    <div class="layui-input-inline">
        <input type="text" class="input-text layui-input" size="5"  name="setup[default]" value="{$default}" />
    </div>
</div>
{/case}

{case value="checkbox"}
<div class="layui-form-item">
    <label class="layui-form-label">选项列表</label>
    <div class="layui-col-lg4">
        <textarea  name="setup[options]" class="layui-textarea">{$options}</textarea>
    </div>
    <div class="layui-form-mid layui-word-aux">例：选项名称|值</div>
</div>
<div class="layui-form-item">
    <label class="layui-form-label">字段类型</label>
    <div class="layui-input-inline">
        <select name="setup[fieldtype]" onchange="javascript:numbertype(this.value);">
            <option value="varchar" <?php if($fieldtype=='varchar') echo 'selected';?>>字符 VARCHAR</option>
            <option value="tinyint" <?php if($fieldtype=='tinyint') echo 'selected';?>>整数 TINYINT(3)</option>
            <option value="smallint" <?php if($fieldtype=='smallint') echo 'selected';?>>整数 SMALLINT(5)</option>
            <option value="mediumint" <?php if($fieldtype=='mediumint') echo 'selected';?>>整数 MEDIUMINT(8)</option>
            <option value="int" <?php if($fieldtype=='int') echo 'selected';?>>整数 INT(10)</option>
        </select>
        <span id="numbertype" style="display:none;"  >
            <input type="checkbox" name = "setup[numbertype]" value="1" checked title="不包括负数"/>
        </span>
    </div>
</div>
<div class="layui-form-item">
    <label class="layui-form-label">默认值</label>
    <div class="layui-input-inline">
        <input type="text" class="input-text layui-input" size="5"  name="setup[default]" value="{$default}" />
    </div>
</div>
{/case}

{case value="number"}
<div class="layui-form-item">
    <label class="layui-form-label">是否包括负数</label>
    <div class="layui-input-inline">
        <input type="radio" name="setup[numbertype]" value="1" title="是" <?php if($numbertype ==1) echo 'checked';?>>
        <input type="radio" name="setup[numbertype]" value="0" title="否" <?php if($numbertype ==0) echo 'checked';?>>
    </div>
</div>
<div class="layui-form-item">
    <label class="layui-form-label">小数位数</label>
    <div class="layui-input-inline">
        <select name="setup[decimaldigits]">
            <option value="0"<?php if($decimaldigits==0) echo ' selected';?>>0</option>
            <option value="1"<?php if($decimaldigits==1) echo ' selected';?>>1</option>
            <option value="2"<?php if($decimaldigits==2) echo ' selected';?>>2</option>
            <option value="3"<?php if($decimaldigits==3) echo ' selected';?>>3</option>
            <option value="4"<?php if($decimaldigits==4) echo ' selected';?>>4</option>
            <option value="5"<?php if($decimaldigits==5) echo ' selected';?>>5</option>
        </select>
    </div>
</div>
<div class="layui-form-item">
    <label class="layui-form-label">默认值</label>
    <div class="layui-input-inline">
        <input type="text" name="setup[default]" value="{$default}" size="40" class="input-text layui-input">
    </div>
</div>
{/case}

{case value="image"}
<div class="layui-form-item">
    <label class="layui-form-label">图片类型</label>
    <div class="layui-input-inline">
        <input type="text" name="setup[upload_allowext]" value="{$upload_allowext}" class="input-text layui-input">
    </div>
</div>
{/case}

{case value="images"}
<div class="layui-form-item">

</div>
{/case}

{case value="file"}
<div class="layui-form-item">
    <label class="layui-form-label">文件类型</label>
    <div class="layui-input-inline">
        <input type="text" name="setup[upload_allowext]" value="{$upload_allowext}" class="input-text layui-input">
    </div>
</div>
{/case}

{case value="files"}
<div class="layui-form-item">
</div>
{/case}
{default /}
{/switch}
<script>
    function numbertype(fieldtype){
        if(fieldtype=='varchar'){
            $('#numbertype').hide();
        }else{
            $('#numbertype').show();
        }
    }
    {if condition="!empty($fieldtype) && $fieldtype!='varchar'"}
    $('#numbertype').show();
    {/if}
</script>